//
//  ViewController.m
//  SingleDemoForAAChartKit
//
//  Created by 蓓蕾 on 2021/8/2.
//

#import "ViewController.h"
#import "XueTangViewController.h"
#import "XueZhiViewController.h"
#import "XueQingViewController.h"
#import "XinDianViewController.h"
#import "BaiXiBaoViewController.h"
#import "BaiXiBaoBgColorViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    NSLog(@"开始了");

    UIButton *xueTangXueYangView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:xueTangXueYangView];
    xueTangXueYangView.tag = 1;
    xueTangXueYangView.titleLabel.numberOfLines = 2;
    [xueTangXueYangView setTitle:@"血糖血压分析图\n不带图例" forState:UIControlStateNormal];
    [xueTangXueYangView setTitleColor:rgbColor(0xffffff) forState:UIControlStateNormal];
    xueTangXueYangView.titleLabel.font = [UIFont systemFontOfSize:15];
    [xueTangXueYangView addTarget:self action:@selector(xuetangxueyaAction:) forControlEvents:UIControlEventTouchUpInside];
    xueTangXueYangView.frame = CGRectMake(10, 200, 120, 50);
    xueTangXueYangView.backgroundColor = [UIColor purpleColor];
    xueTangXueYangView.layer.cornerRadius = 10;



    UIButton *xueZhiView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:xueZhiView];
    xueZhiView.tag = 2;
    xueZhiView.titleLabel.numberOfLines = 2;
    [xueZhiView setTitle:@"血脂折线分析图\n有图例[禁止交互]" forState:UIControlStateNormal];
    [xueZhiView setTitleColor:rgbColor(0xffffff) forState:UIControlStateNormal];
    xueZhiView.titleLabel.font = [UIFont systemFontOfSize:15];
    [xueZhiView addTarget:self action:@selector(xuetangxueyaAction:) forControlEvents:UIControlEventTouchUpInside];
    xueZhiView.frame = CGRectMake(CGRectGetMinX(xueTangXueYangView.frame), CGRectGetMaxY(xueTangXueYangView.frame) + 20, CGRectGetWidth(xueTangXueYangView.frame), CGRectGetHeight(xueTangXueYangView.frame));
    xueZhiView.backgroundColor = [UIColor purpleColor];
    xueZhiView.layer.cornerRadius = 10;



    UIButton *xinDianView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:xinDianView];
    xinDianView.tag = 4;
    xinDianView.titleLabel.numberOfLines = 2;
    [xinDianView setTitle:@"心电折线分析图\n没有图例" forState:UIControlStateNormal];
    [xinDianView setTitleColor:rgbColor(0xffffff) forState:UIControlStateNormal];
    xinDianView.titleLabel.font = [UIFont systemFontOfSize:15];
    [xinDianView addTarget:self action:@selector(xuetangxueyaAction:) forControlEvents:UIControlEventTouchUpInside];
    xinDianView.frame = CGRectMake(CGRectGetMaxX(xueTangXueYangView.frame) + 20, CGRectGetMaxY(xueTangXueYangView.frame) + 20, CGRectGetWidth(xueTangXueYangView.frame), CGRectGetHeight(xueTangXueYangView.frame));
    xinDianView.backgroundColor = [UIColor purpleColor];
    xinDianView.layer.cornerRadius = 10;



    UIButton *xueQingView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:xueQingView];
    xueQingView.tag = 3;
    xueQingView.titleLabel.numberOfLines = 2;
    [xueQingView setTitle:@"血清曲线分析图\n没有图例" forState:UIControlStateNormal];
    [xueQingView setTitleColor:rgbColor(0xffffff) forState:UIControlStateNormal];
    xueQingView.titleLabel.font = [UIFont systemFontOfSize:15];
    [xueQingView addTarget:self action:@selector(xuetangxueyaAction:) forControlEvents:UIControlEventTouchUpInside];
    xueQingView.frame = CGRectMake(CGRectGetMinX(xueZhiView.frame), CGRectGetMaxY(xueZhiView.frame) + 20, CGRectGetWidth(xueZhiView.frame), CGRectGetHeight(xueZhiView.frame));
    xueQingView.backgroundColor = [UIColor purpleColor];
    xueQingView.layer.cornerRadius = 10;

    UIButton *baiXiBaoView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:baiXiBaoView];
    baiXiBaoView.tag = 5;
    baiXiBaoView.titleLabel.numberOfLines = 2;
    [baiXiBaoView setTitle:@"白细胞折线分析图 没有图例" forState:UIControlStateNormal];
    [baiXiBaoView setTitleColor:rgbColor(0xffffff) forState:UIControlStateNormal];
    baiXiBaoView.titleLabel.font = [UIFont systemFontOfSize:15];
    [baiXiBaoView addTarget:self action:@selector(xuetangxueyaAction:) forControlEvents:UIControlEventTouchUpInside];
    baiXiBaoView.frame = CGRectMake(CGRectGetMinX(xueZhiView.frame), CGRectGetMaxY(xueQingView.frame) + 20, CGRectGetWidth(xueZhiView.frame), CGRectGetHeight(xueZhiView.frame));
    baiXiBaoView.backgroundColor = [UIColor purpleColor];
    baiXiBaoView.layer.cornerRadius = 10;
    
    UIButton *baiXiBaoBgColorView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:baiXiBaoBgColorView];
    baiXiBaoBgColorView.tag = 6;
    baiXiBaoBgColorView.titleLabel.numberOfLines = 2;
    [baiXiBaoBgColorView setTitle:@"白细胞折线分析图 加背景颜色" forState:UIControlStateNormal];
    [baiXiBaoBgColorView setTitleColor:rgbColor(0xffffff) forState:UIControlStateNormal];
    baiXiBaoBgColorView.titleLabel.font = [UIFont systemFontOfSize:15];
    [baiXiBaoBgColorView addTarget:self action:@selector(xuetangxueyaAction:) forControlEvents:UIControlEventTouchUpInside];
    baiXiBaoBgColorView.frame = CGRectMake(CGRectGetMaxX(baiXiBaoView.frame) + 20, CGRectGetMinY(baiXiBaoView.frame), CGRectGetWidth(xueZhiView.frame), CGRectGetHeight(xueZhiView.frame));
    baiXiBaoBgColorView.backgroundColor = [UIColor purpleColor];
    baiXiBaoBgColorView.layer.cornerRadius = 10;
}

-(void)xuetangxueyaAction:(UIButton *)sender
{
    NSInteger tag = sender.tag;
    switch (tag) {
        case 1:
        {
            XueTangViewController *xueTangXueYaVC = [[XueTangViewController alloc] init];
            xueTangXueYaVC.navigationItem.title = @"血糖血压分析";
            [self.navigationController pushViewController:xueTangXueYaVC animated:YES];
        }
            break;
        case 2:
        {
            XueZhiViewController *xueTangXueYaVC = [[XueZhiViewController alloc] init];
            xueTangXueYaVC.navigationItem.title = @"血脂折线图分析";
            [self.navigationController pushViewController:xueTangXueYaVC animated:YES];
        }
            break;
        case 3:
        {
            XueQingViewController *xueTangXueYaVC = [[XueQingViewController alloc] init];
            xueTangXueYaVC.navigationItem.title = @"血清曲线图分析";
            [self.navigationController pushViewController:xueTangXueYaVC animated:YES];
        }
            break;
        case 4:
        {
            XinDianViewController *xueTangXueYaVC = [[XinDianViewController alloc] init];
            xueTangXueYaVC.navigationItem.title = @"心电折线分析图";
            [self.navigationController pushViewController:xueTangXueYaVC animated:YES];
        }
            break;
        case 5:
        {
            BaiXiBaoViewController *baiXiBaoVC = [[BaiXiBaoViewController alloc] init];
            baiXiBaoVC.navigationItem.title = @"白细胞折线分析图(无背景色)";
            [self.navigationController pushViewController:baiXiBaoVC animated:YES];
        }
            break;
        case 6:
        {
            BaiXiBaoBgColorViewController *baiXiBaoVC = [[BaiXiBaoBgColorViewController alloc] init];
            baiXiBaoVC.navigationItem.title = @"白细胞折线分析图(有背景色)";
            [self.navigationController pushViewController:baiXiBaoVC animated:YES];
        }
            break;

        default:
            break;
    }

}


@end
